package com.qf.myshop.controller;

import com.alibaba.fastjson.JSON;
import com.qf.myshop.entity.WeiXin;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/pay.do")
public class PayServlet extends BaseServlet {
    public void pay(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String oid = request.getParameter("oid");
        System.out.println(oid);
        String result = request.getParameter("result");
        System.out.println(result);
        WeiXin weiXin = JSON.parseObject(result, WeiXin.class);
        request.getRequestDispatcher("paysuccess.jsp").forward(request, response);
    }
}
